package com.jk.controller;

import com.jk.bean.Page;
import com.jk.bean.SendPage;
import com.jk.bean.Stv;
import com.jk.service.PingService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("ping")
public class PingController {
    @Resource
    private PingService pingService;


   //====后台敏感词
    @ResponseBody
    @RequestMapping("getStv")
    public SendPage getStv(Page page){
         SendPage ps= pingService.getStv(page);
        return ps;
    }

    //=====单个
    @ResponseBody
    @RequestMapping("upadStv")
    public Stv updaStv(String id){
        return pingService.updaStv(id);
    }

    //======delete
    @RequiresPermissions(value = "pf:add")
    @ResponseBody
    @RequestMapping("delStv")
    public String delStv(String id){
        pingService.delStv(id);
        return null;
    }

    //=====add
    @RequiresPermissions(value = "pf:add")
    @ResponseBody
    @RequestMapping("addStv")
    public String addStv(Stv s){
        pingService.addStv(s);
        return "";
    }
}
